home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Module1"
- Type snDfs
- filename As String
- tracktitle As String
- End Type
- Global Soundfiles(100) As snDfs
- Global MaxSoundFiles As Integer
- Sub Load()
- MaxSoundFiles = 0
- Open "Sound.Dat" For Input As #1
- Do
- Line Input #1, a$
- If a$ = "[ENDOFFILE]" Then Exit Do
- If a$ = "[SOUNDDEF]" Then
- Soundfilenum = Soundfilenum + 1
- Line Input #1, a$
- propvalue$ = GetPropertyValue(a$)
- Soundfiles(Soundfilenum).tracktitle = propvalue$
- Line Input #1, a$
- propvalue$ = GetPropertyValue(a$)
- Soundfiles(Soundfilenum).filename = propvalue$
- End If
- Loop
- Close #1
- MaxSoundFiles = Soundfilenum
- End Sub
- Sub Save()
-
- Open "Sound.Dat" For Output As #1
- Print #1, "ION FORMAT VERSION: 1.0"
- For i = 1 To MaxSoundFiles
- Print #1, "[SOUNDDEF]"
- Print #1, "Name: " & Soundfiles(i).tracktitle
- Print #1, "FileName: " & Soundfiles(i).filename
- Print #1, "[ENDMUSICDEF]"
- Next i
- Print #1, "[ENDOFFILE]"
- Close #1
- End Sub
- Public Function GetPropertyValue(TextString) As String
- GetPropertyValue = Right$(TextString, Len(TextString) - InStr(1, TextString, " "))
- End Function
- Public Function GetPropertyName(TextString) As String
- If InStr(1, TextString, " ") = 0 Then
- GetPropertyName = TextString
- Else
- GetPropertyName = Left$(TextString, InStr(1, TextString, " ") - 1)
- End If
- End Function
- Sub UpdateList()
- Currindex = Form1.List1.ListIndex
- Form1.List1.Clear
- Form1.List1.AddItem "[NewSoundDef]"
- For i = 1 To MaxSoundFiles
- Form1.List1.AddItem Soundfiles(i).tracktitle
- Next i
- Form1.List1.ListIndex = Currindex
- End Sub
- Sub UpdateProperties()
- mnum = Form1.List1.ListIndex
- Form1.Text1.Text = Soundfiles(mnum).tracktitle
- Form1.Text2.Text = Soundfiles(mnum).filename
- End Sub
-